//
//  CountryCell.m
//  Lovelife
//
//  Created by dllo on 15/4/21.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "CountryCell.h"
@implementation CountryCell
- (void)dealloc
{
    [_bgImageView release];
    [_countryNameLable release];
    [_numberCitiesLabel release];
    [super dealloc];
}
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // 背景图片
        self.bgImageView = [[UIImageView alloc]init];

        [self addSubview:self.bgImageView];
        [_bgImageView release];
        
        // 国家名称标签
        self.countryNameLable = [[BaseLabel alloc]init];
        self.countryNameLable.backgroundColor = [UIColor clearColor];
        self.countryNameLable.textColor = [UIColor whiteColor];
        self.countryNameLable.font = [UIFont systemFontOfSize:15];
        self.countryNameLable.numberOfLines = 0;
        self.countryNameLable.lineBreakMode = NSLineBreakByWordWrapping;
        [self addSubview:self.countryNameLable];
        [_countryNameLable release];
        
        // 城市数标签
        self.numberCitiesLabel = [[BaseLabel alloc]init];
        self.numberCitiesLabel.backgroundColor = [UIColor clearColor];
        self.numberCitiesLabel.textColor = [UIColor whiteColor];
        self.numberCitiesLabel.textAlignment = 1;
        self.numberCitiesLabel.numberOfLines = 0;
        [self addSubview:self.numberCitiesLabel];
        [_numberCitiesLabel release];

    }
    return self;
}
-(void)layoutSubviews
{
    [super layoutSubviews];
    self.bgImageView.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height);
    self.countryNameLable.frame = CGRectMake(0, self.frame.size.height - 50, self.bgImageView.frame.size.width, 50);
    self.numberCitiesLabel.frame = CGRectMake(self.frame.size.width - 65, 10, 55, 60);
}



/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
